<?php
class Report extends P_Controller
{
	function __Construct()
	{
		parent::__Construct();	
		$this->load->model("journal");
	}

	function add_record()
	{
		$record = $this->input->post("record");
		$json = json_decode($record);
		
		if($json){
			$data = array("status"=>1,"lon"=>$json->lon,"record"=>$record);
			
			//save 
			$data_save = array("lon"=>$json->lon,"lat"=>$jsoin->lat);
			//$this->journal->save($data_save);
			$this->db->insert("journal",$data_save);
			
		}else{
			$data = array("status"=>1);
		}
		$this-> _built_json(json_encode($data));
	}
}
?>